* Replication code for Figures 1 and 2 of "A Computational Model for Identifying Delegating and Constraining Provisions in European Union Laws"
* Fabio Franchino, Marta Migliorati, Giovanni Pagano and Valerio Vignoli
* European Union Politics

version 18
clear all
use dataset.dta
graph set window fontface "Verdana"

* Collapse data by year
collapse del_ms_r con_ms_r so_ms_r discr_ms_r discr_ms_r2 del_nca_r con_nca_r so_nca_r discr_nca_r discr_nat_r discr_nca_r2 discr_nat_r2 agenda_r del_com_r si_com_r con_com_r discr_com_r del_age_r si_age_r con_age_r discr_age_r discr_sup_r (sum) no_act s_count, by(year)

*************** Figure 1: Number of laws and legal sentences
line no_act year, lc(black) || line s_count year, lc(black) lp(longdash) yaxis(2) legend(region(c(none)) pos(0) bplace(nw) col(1) size(small) label(1 "Laws") label(2 "Sentences")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") ytitle("Laws") ytitle("Sentences in the enacting terms", axis(2))  xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("", size(3) c(black)) saving(Figure_1, replace)

graph export "Figure_1.png", as(png) name("Graph") replace


*************** Figure 2: Trends in authority delegation and constraint across executive actors
graph set window fontface default

* Member States
line del_ms_r year, lc(black) || line so_ms_r year, lc(black) lp(longdash) || line con_ms_r year, lc(black) lp(shortdash) legend(region(c(none)) pos(0) bplace(nw) col(2) size(small) label(1 "Delegation") label(2 "Soft obligation") label(3 "Constraint")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("Member States", size(3) c(black)) saving(trendMS, replace)

* Competent Authorities
line del_nca_r year, lc(black) || line so_nca_r year, lc(black) lp(longdash) || line con_nca_r year, lc(black) lp(shortdash) legend(region(c(none)) pos(0) bplace(nw) col(2)  size(small) label(1 "Delegation") label(2 "Soft obligation") label(3 "Constraint")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("National authorities", size(3) c(black)) saving(trendCA, replace)

* Commission
line agenda_r year, lc(black) lp(dash_dot) || line del_com_r year, lc(black) || line si_com_r year, lc(black) lp(longdash)|| line con_com year, lc(black) lp(shortdash) legend(region(c(none)) pos(0) bplace(nw) col(2) size(small) label(1 "Agenda setting") label(2 "Delegation") label(3 "Soft implementation") label(4 "Constraints")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("European Commission", size(3) c(black)) saving(trendCOM, replace)

* Supranational Agencies
line del_age_r year, lc(black) || line si_age_r year, lc(black) lp(longdash) || line con_age_r year, lc(black) lp(shortdash) legend(region(c(none)) pos(0) bplace(nw) col(2) size(small) label(1 "Delegation") label(2 "Soft implementation") label(3 "Constraint")) graphregion(fcolor(white)) xlabel(1958 (10) 2019) xtitle("") xlabel(1958 (10) 2019, nogrid labsize(3)) ylabel(, nogrid labsize(3)) title("Supranational agencies", size(3) c(black)) saving(trendAGE, replace)

gr combine trendMS.gph trendCA.gph trendCOM.gph trendAGE.gph, col(2) graphregion(fcolor(white)) saving(Figure_2, replace)

graph export "Figure_2.png", as(png) name("Graph") replace



